/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author YDZ
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';
import { UploadApiResult } from '../sys/upload';
import { UploadFileParams } from '/#/axios';

const { ctxPath, adminPath } = useGlobSetting();

export interface ShopCusFl extends BasicModel<ShopCusFl> {
  compName?: string; // 分公司名称
  costName?: string; // 费用名称
  money?: number; // 金额
  deptname?: string; // 返点客户所属部门
  payType?: string; // 支付方式
  cusCode?: string; // 客户编码
  expId?: string; // 导入ID
}

export const shopCusFlList = (params?: ShopCusFl | any) =>
  defHttp.get<ShopCusFl>({ url: adminPath + '/shop/cus/shopCusFl/list', params });

export const shopCusFlListData = (params?: ShopCusFl | any) =>
  defHttp.post<Page<ShopCusFl>>({ url: adminPath + '/shop/cus/shopCusFl/listData', params });

export const shopCusFlForm = (params?: ShopCusFl | any) =>
  defHttp.get<ShopCusFl>({ url: adminPath + '/shop/cus/shopCusFl/form', params });

export const shopCusFlSave = (params?: any, data?: ShopCusFl | any) =>
  defHttp.postJson<ShopCusFl>({ url: adminPath + '/shop/cus/shopCusFl/save', params, data });

export const shopCusFlImportData = (
  params: UploadFileParams,
  onUploadProgress: (progressEvent: ProgressEvent) => void,
) =>
  defHttp.uploadFile<UploadApiResult>(
    {
      url: ctxPath + adminPath + '/shop/cus/shopCusFl/importData',
      onUploadProgress,
    },
    params,
  );

export const shopCusFlDelete = (params?: ShopCusFl | any) =>
  defHttp.get<ShopCusFl>({ url: adminPath + '/shop/cus/shopCusFl/delete', params });

export const shopCusFlConfirm = (params?: ShopCusFl | any) =>
  defHttp.get<ShopCusFl>({ url: adminPath + '/shop/cus/shopCusFl/confirm', params });

export const shopCusFlCancel = (params?: ShopCusFl | any) =>
  defHttp.get<ShopCusFl>({ url: adminPath + '/shop/cus/shopCusFl/cancel', params });

export const shopCusFlBatchDelete = (params?: ShopCusFl | any) =>
  defHttp.get<ShopCusFl>({ url: adminPath + '/shop/cus/shopCusFl/batchDelete', params });

export const shopCusFlEnableAll = (params?: ShopCusFl | any) =>
  defHttp.get<ShopCusFl>({ url: adminPath + '/shop/cus/shopCusFl/enableAll', params });

export const shopCusFlDelByExpId = (params?: ShopCusFl | any) =>
  defHttp.get<ShopCusFl>({ url: adminPath + '/shop/cus/shopCusFl/deleteByExpID', params });
